home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
logbatch
/
gledt.exe
/
GLEDIT.DOC
next >
Wrap
Text File
|
1993-09-29
|
26KB
|
588 lines
/GLEDIT
Global File Editor
USER'S GUIDE
Copyright 1990, 1993 by Gary C. Crider and
Parity Solutions
TABLE OF CONTENTS:
What is GLEDIT? .................................. 1.0
The GLEDIT command line .......................... 2.0
Escape Sequences for Special Characters .......... 2.1
Operational Notes and Cautions ................... 3.0
Locating Data .................................... 4.0
Modifying Data ................................... 5.0
Printing or Saving the Output .................... 6.0
Return Codes ..................................... 7.0
Compatibility with Prior Releases ................ 8.0
Installation ..................................... Appendix A
Disclaimer ....................................... Appendix B
Support .......................................... Appendix C
Registration ..................................... Appendix D
1.0 What Is GLEDIT?
GLEDIT lets you globally search for, and optionally replace, a string of
characters in all selected files a directory. If you are familiar with GREP
from Borland International, you know the power of being able to search all
.BAT files in your BATCH directory when you move some applications to a new
disk volume. You are able to tell immediately which batch files need to be
modified.
GLEDIT takes it a step further in letting you also specify the string that
is to replace the search string and does the update of the file for you. It
prompts you before changing each line that may require modification.
2.0 The GLEDIT Command Line
Format:
GLEDIT [path]filespec "searchstring" ["replacestring"] [switches]
The "filespec" is the file name of the file that you want to search or
edit. If the "filespec" is a wildcard specification, all matching files in
"path" will be searched/edited. If "path" is not specified, the current
directory is used. If a mapped network directory is used for the path, the
full directory path should be specified, rather than just the drive letter.
For example, use W:\UTIL\*.* rather than W:*.* if W: is mapped to the UTIL
directory. Do not use the actual network drive names in the path such as
APPL:\UTIL\*.*.
The "searchstring" is the string of characters to look for in each
matching file. It should be enclosed in quotes if it contains spaces, commas
or characters other than letters or numbers.
The "replacestring" is the new string to be inserted in place of the
"searchstring". It does not have to be the same length as the "searchstring".
The new record length will be adjusted to accommodate the replacement. It
should be enclosed in quotes if it contains spaces, <, >, or |. If you
specify "" as the "replacestring", then nothing is inserted in place of the
"searchstring", in effect deleting it from the record.
Either string may contain quotes by using the ~q escape sequence described
in the next section.
The replace string may not be exactly the same as a switch, unless
enclosed in quotes. The switch characters may also be embedded within a
replace string.
Switches:
/I indicates case-insensitive searching where the search argument and the
target record will match if they contain the same letters regardless of
upper or lower case. /I has no effect on "replacestring". The "replace-
string" is inserted as entered in the command line.
/N directs output to the standard output device (normally the display).
GLEDIT normally writes to the screen with color highlighting of the matched
string. Output directed to the screen cannot be redirected to another
device. The standard output can be directed to another device such as
a file or printer. If you specify /N and do not redirect the output, it
will appear on the screen without color highlighting.
/S is ignored if "replacestring" was specified. If not specified, the
scrolling text on the display will pause for a key to be hit between files
with matches for "searchstring". If /S is specified, scrolling is continuous.
/Y is used to automatically reply Y to the replace prompts when in
edit (replace) mode. Please see "Operational Notes and Cautions" before
using this parameter. It is ignored in search mode.
/T (test mode) performs just exactly like /Y except that no changes are
actually made to any files. You can test the results before changing it to
/Y. /T is ignored in search mode.
2.1 Escape Sequences for Special Characters
Sometimes ASCII text files contain some special characters that are not
normally considered text characters. GLEDIT lets you search and replace
using some of these characters by substituting escape sequences in the
search/replace strings fo these characters. Please read the notes below
concerning each escape sequence before using them.
The following escape sequences are used within the searchstring and
replacestring to represent the presence of special characters that either
cannot be entered on the command line, or may cause problems if they are.
The character following the tilde (~) must be lower case.
~b = Bell [BEL] (ASCII 7)
~e = Escape (ASCII 27)
~f = Form feed (ASCII 12)
~p = Percent sign [%] (ASCII 37)
~n = Line feed (ASCII 10)
~q = Double quote ["] (ASCII 34)
~r = Carraige return (ASCII 13)
~t = Horizontal tab (ASCII 9)
~~ = Tilde [~] (ASCII 126)
NOTES-
~b - The BEL character causes a beep on the speaker when displayed, but
does not display as any character. In order for you to see where it
is located in the line, the prompts will display the BEL character
as a heart. It will not show up at all when /N is specified.
~e - The ESC character is used to indicate ANSI.SYS and printer escape
(control) sequences. To prevent interference with the display,
the prompts will display the ESC character as a happy face. It
will not show up at all when /N is specified.
~f - The form feed character causes the printer to eject a page. It shows
up on the prompt line as circle over a cross, the female sign. To
prevent page ejects when routed to a printer, it is omitted from the
prompt lines when /N is used.
~p - Using the ~p sequence in place of the percent sign (%) prevents DOS
from trying to interpret %1-%9 and paired percent signs as command
string and environment variables when GLEDIT is executed within a
batch file. DOS attempts this variable substitution regardless of the
presence of quotes in the line. If the variable is not found in the
command line or environment, whatever it interprets as a variable
vanishes. This is ture even if there are spaces between paired
percent signs.
~n - The line feed causes the printer or display to advance one line.
Removing or inserting a line feed will join or split a line of text.
When using ~n you are actually searching for or inserting carraige
return/line feed (CR/LF) pairs. These CR/LF pairs are found at the
end of each text file record. See the note on ~r.
~q - Double quotes within the search/replace strings must be entered using
the ~q escape sequence becuase otherwise DOS will misinterpret the
command line. The \q which was used in earlier releases is no longer
supported.
~r - The carraige return character causes the printer or display cursor to
return to the start of the current line. The Borland C++ text mode
input routines ignore carraige returns, and read in carraige return/
line feed pairs (CR/LF) as line feed characters. Thus, a search for
a carraige return will always fail to find a match. You may, however
insert carraige returns by putting them in the replace string. See
the note on ~n.
~t - The horizontal tab character displays or prints a number of spaces
whenever it is sent to the display or printer. Usually this defaults
to 8 spaces, but can be set to other values within many programs. The
tab shows up in prompts as a diamond character.
~~ - You may search for or replace the tilde character by using two tildes
(~~) to represent one. If a single tilde is encountered that is not
followed by one of the above lower case letters, it is treated the
same as ~~.
Some uses for special characters include joining lines by removing ~n,
splitting lines by inserting ~n pair, replacing tab characters with the
desired number of spaces, removing form feeds from printer files, searching
for and replacing LaserJet escape sequences, etc.
If your keyboard does not have a tilde, hold the ALT key down and press
126 on the keypad.
Most international and graphic characters can be entered in the same
manner, by holding the ALT key and entering the decimal value of the ASCII
code on the numeric keypad.
PLEASE NOTE- Some of the special characters are removed from the records
displayed on the screen due to the unwanted results they might cause when
displayed or redirected to a printer. These characters are ~b, ~e and ~f.
The characters are present, however, in the records read from or written to
the file.
3.0 Operational Notes and Cautions
Please note that GLEDIT is intended for use in ASCII text files that
use the standard CR/LF record delimiters. If you use it on binary or non-
standard files, the resulting file will probably be unusable. If you use
GLEDIT on indexed database records and substitute unequal length strings, you
are almost sure to corrupt your database. GLEDIT does not back up files
before replacing them, so be careful and be sure of what you are doing. The
safest approach is to backup the directory, possibly in an archive (.ZIP,
.ARC, etc.) file before editing with GLEDIT.
GLEDIT has two modes of operation, search and edit. Whenever a replacement
string is specified, edit mode is activated. If no replacement string is
provided, search mode is invoked. In search mode, no file writes whatsoever
take place, therefore no data is modified. When edit mode is invoked, a work
file is written to the target directory. As each record is read in, it is
also written to the work file, modified or not. When GLEDIT reaches end of
file on the input file, it checks to see if you had elected to make any
modifications. If so, it deletes the input file and renames the work file to
the name of the input file. The point of relating all of this is that you
should not specify a replacement string if you are just looking for
occurrences of a string. Edit mode has much higher overhead.
Please be extremely cautious when using the /Y parameter. This is for
users who like to live on the edge and believe, "It's my data and I'll
corrupt it if I want to." A miskeyed command line or not thinking through
what is going to be the result can cause file damage on a vast scale. If
/Y is specified, the only way to stop it is with CTRL-BREAK. Even this
could cause a file to be damaged. Specify BREAK=ON in your CONFIG.SYS
file to make sure you can break out if things are going badly. Use the
/T switch to test the result before changing it to /Y.
It is a good idea to use /N and redirect the output to a file or printer
during execution of /Y or /T. This gives a log of the results. See Printing
or Saving the Output.
If at any time you wish to abort a search, press the ESC key.
4.0 Locating Data
The primary purpose of GLEDIT is to let you find files that contain certain
strings, generally because the strings need to be modified, but not always.
If you just want to find what files contain a certain string, just enter
the GLEDIT command without a replacement string.
GLEDIT will begin going through the target directory finding each file that
matches the filespec you provided in the command line. It will search each
of the matching files for the search string you provided. When found, the
file name will be displayed along with any records in the file containing the
search string. If you did not specify /N, the text will be light gray on a
black background with the search string highlighted in light red text. If you
did not specify /S, the display scrolling will pause at the end of each file
with matching strings and wait for a key to be pressed before proceeding to
search the next file.
5.0 Modifying Data
Edit mode processing involves everything described under Locating Data
(except /S) plus you are prompted to reply Y or N depending on whether or
not you want matching records updated as each is displayed. GLEDIT also
displays the modified line as it will appear if you reply Y. You can see
the result before you accept it.
If you specify "" as the replace string, any matches of the search string
are deleted from the record.
6.0 Printing or Saving the Output
To print the output of a search, or an edit using /Y or /T, specify the /N,
and /S if in search mode, parameters and redirect the output to the printer:
GLEDIT *.TXT "MOM" /N /S >PRN
or log to a file:
GLEDIT *.BAT "G:" "H:" /N /T >C:\GLEDIT.LOG
You can use >> instead of > if you want the output appended to a log file
instead of creating a new log each time.
Do not use redirection when using edit mode (without /Y or /T) or without
the /S in search mode. The resulting pauses will make it appear that GLEDIT
is hung, since you will not see the prompts. If this happens, repeatedly
pressing N will allow GLEDIT to progress to completion.
7.0 Return Codes
The following DOS ERRORLEVEL return codes are returned from GLEDIT:
0 - One or more matches found. Replaced or not replaced has no bearing.
1 - No matches found in any files searched.
2 - No files found matching the search file specification.
3 - Invalid path specified in serach file specification.
4 - Directory recursion error. Please report to Parity Solutions.
Should never happen.
255 - User abort. ESC key pressed. Does not detect BREAK key.
8.0 Compatibility with Prior Releases
Versions prior to 2.5 used \q to indicate a quote within a search/replace
string. This is no longer supported. The ~q escape sequence is used
instead.
If you have edits set up in batch files or scripts, check them to make sure
that the search and replace strings do not contain any of the allowed escape
sequences. If they do, replace the tilde (~) with two tildes (~~). This is
necessary when going from a release prior to 2.5 to release 2.5 or later.
See the section, Escape Sequences for Special Characters.
APPENDIX A
Installation
GLEDIT is distributed in a self-extracting ZIP file called GLEDT.EXE. It
contains the following files:
GLEDIT.EXE The executable file for GLEDIT.
GLEDIT.DOC The documentation file.
GLEDIT.HST History of changes to GLEDIT.
GLEDIT.Vnn Description of changes to implement version nn,
the current version.
PRODUCTS.DOC A text file describing all Parity Solutions
products.
For best results, unzip the file into a directory on your PATH. If you
don't use a directory in your path, you will have to designate the directory
containing GLEDIT.EXE when executing the program.
If you have a utility directory that is on your PATH, this is an excellent
location for GLEDIT. An example installation would be:
C:
CD \UTIL
COPY [path]GLEDT.EXE
GLEDT
DEL GLEDT.EXE
If they are not currently in your path, simply copy all of the files to a
directory in your path. Keep the GLEDT.EXE file anywhere you like, but give
plenty of copies, as is, to your friends. If you register GLEDIT, you are not
licensed to give your serial number to anybody without first removing the
serialization from your copy.
APPENDIX B
Disclaimer
BECAUSE OF THE DIVERSE NATURE OF COMPUTER EQUIPMENT AND EXPERTISE OF USERS,
PARITY SOLUTIONS AND GARY C. CRIDER MAKE NO WARRANTY ON THE GLEDIT PROGRAM
WHATSOEVER, EXPRESSED OR IMPLIED. THE USER ASSUMES ALL RISK OF DAMAGE TO
DATA OR EQUIPMENT RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OR MISUSE OF
THIS PROGRAM PRODUCT. THE USER MUST BE AWARE THAT USING GLEDIT TO MAKE
ALTERATIONS TO PROGRAMS OR DATA CAN RENDER THAT PROGRAM OR DATA USELESS.
USERS ARE ADVISED TO TEST MODIFICATIONS MADE WITH GLEDIT THOROUGHLY ON FILES
FOR WHICH A BACKUP EXITS. ANY LIABILITY OF THE AUTHOR OR PARITY SOLUTIONS IS
LIMITED TO REPLACEMENT OR REFUND OF THE REGISTRATION FEE.
APPENDIX C
Support
I have tried to test the program to the fullest, but I am limited as to
systems and configurations with which to test. I have been programming for 18
years and the one thing I know for sure is that bug free programs are very few
and far between. I can only promise to support the program to the best of my
ability and provide fixes as expeditiously as possible. GLEDIT has been used
at my home and work site extensively for several years and has proven to be a
reliable tool.
Anyone can report problems and suggest changes. Registered users get top
priority in resolving their problems. There are three ways you can report
problems. The preferred method is to contact me through CIS mail (not forum
messages). My CIS ID is 71760,3413. You can also write me at:
Gary C. Crider
Parity Solutions
1105 Burgess Court
Arlington, TX 76015
On 10/31/93 we will move to:
1903 Pavia Court
Arlington, TX 76006
The last method is to phone (817) 467-7818. Since I am the sole technical
support and the line is also used for my network consulting business, it is
often hard to get through to me. Please call and leave a message between 7:30
am and 5:30 pm Central time.
No matter which method you use, please give a brief description of your
problem, your registration serial number if you are registered, and your phone
number. If I need more information, I will contact you as soon as I can.
When I have a solution, I will contact you however you prefer.
I work full time, have a consulting business to run in my spare time and
write programs instead of sleeping. So please be a little patient with me.
Program updates are available on CompuServe or can be requested from us
for a $5 shipping and handling charge. Add $1 for international shipping
outside the North American continent. A distribution disk of all Parity
Solutions products will be sent to you. Specify disk size and format. You
may use the order form at the end of this document.
APPENDIX D
Registration
I begin with an apology. I hate programs that in any way inhibit func-
tionality or performance for the shareware version. But when it came down to
feeding the family and paying the bills, I had a change of heart and inserted
a pesky notice that pops up at the beginning and gets on your nerves. I
chose this approach above that of limited functionality. The program's full
capabilities are available for you to evaluate before you invest your hard-
earned money.
You may use GLEDIT unlicensed for 30 days, after which time you are
required to be registered.
Registered users will receive a unique serial number and instructions on
how to serialize the program. Serialization can be re-applied to updated
versions and in no way hinders your use of the program. You can compress or
decompress the program with no effect (LZEXE or PKLITE). I use Fabrice
Bellard's LZEXE program on GLEDIT.EXE before distribution.
As a registered user, you will be able to update without re-registration
or additional fees. You will also be kept on my PRIVATE mailing list to
receive additional information on other Parity Solutions products.
To register your copy, please use the order form below and send $16 ($45
per file server on LANs) check or money order (sorry, no credit cards yet)
to:
Gary C. Crider
Parity Solutions
1105 Burgess Court
Arlington, TX 76015
After 10/31/93 use:
1903 Pavia Court
Arlington, TX 76006
Please use the order form at the end of this document for your
convenience and ours.
Purchase orders are acceptable from U.S. and Canadian companies and
institutions for amounts of $45 or more.
International orders outside the U.S., Canada and Mexico add $1 to the
total order for postage.
Or, you can register online quickly and simply on CompuServe. Simply
GO SWREG and register ID #754. Your registration will be added to your
Compuserve bill. International exchange was never easier and you save the
$1 international postage charge.
If you send your CIS ID or register via SWREG, your registration will be
sent to you via CIS mail, along with instructions on how to serialize your
copy of GLEDIT. This usually involves one day or less turnaround.
Program diskettes are not normally shipped. Normal distribution is via
CompuServe. If you need a diskette, please see the instructions under Support
above, or use the order form below. You will receive a serial number and
instructions for serializing your copy of the program.
Each license gives you or your company a single-use permit for GLEDIT. It
is not restricted to a single machine as long as no two users can be simul-
taneously using the program. As Borland says, "treat it like a book." As an
example, if you register GLEDIT for your home computer, but during the day you
use a portable or a computer at work, you may keep GLEDIT on both machines as
long as no one is at home using it on your home computer.
LAN licenses grant rights to all users of a file server. If inter-
networking, a license must exist for each file server that contains a copy
of GLEDIT.EXE. If two or more file servers exist on a single LAN strictly for
mirroring data and fault-tolerance, these will be counted as a single file
server for licensing purposes. If in doubt, contact me. We can work out
an agreement.
Site licensing is also available on a negotiated price basis. I guarantee
it will be an economical alternative to buying licenses for each user.
If you are a registered user of GEDIT from Parity Solutions, you may use
your GEDIT serial number to serialize GLEDIT.
You may freely distribute the original GLEDT.EXE file in any way you see
fit other than selling it. Users' groups and shareware distribution services
may charge a reasonable fee for the medium and duplication costs, not to
exceed six dollars. Bulletin boards may not charge additional fees for
downloading this specific program, other than normal connect-time and/or
membership charges.
You are NOT licensed to give anyone your serial number unless you first
remove all serialization from your computer. You may then no longer use that
serial number. Only Parity Solutions has the authority to issue serial
numbers.
Modification of GLEDIT.EXE in any manner is prohibited and unlawful.
Licensees of Parity Soultions' GEDIT program may serialize GLEDIT by
renaming GEDIT.SER to GLEDIT.SER.
==============================================================================
ORDER FORM FOR GLEDIT
Send checks payable to:
Parity Solutions After 10/31/93, send to:
1105 Burgess Court 1903 Pavia Court
Arlington, TX 76015 Arlington, TX 76006
BILLING ADDRESS: SHIP TO (If different):
NAME: _____________________________ NAME: ___________________________
COMPANY: _____________________________ COMPANY: _____________________________
STREET: _____________________________ STREET: _____________________________
_____________________________ _____________________________
CITY/ST: _____________________________ CITY/ST: _____________________________
ZIP/POSTAL CODE: _____________________ ZIP/POSTAL CODE: _____________________
COUNTRY: _____________________________ COUNTRY: _____________________________
PHONE: _____________________________ PHONE: _____________________________
CompuServe ID: _______________________(optional)
NOTE: Parity Solutions sends a serial number for each registration and
instructions for serializing your program. A diskette containing
the latest releases of all Parity Solutions shareware products is
available for $5.00 U.S. The current release of GLEDIT is avail-
able for downloading on CompuServe in the IBMSYS forum.
QTY DESCRIPTION PRICE EA. TOTAL PRICE
___ GLEDIT license and registration $16.00 ___________
___ GLEDIT Network license and registration 45.00 ___________
___ Parity Solutions shareware diskette 5.00 ___________
International postage outside U.S., 1.00 ___________
Canada and Mexico.
Total Enclosed: ___________
Diskette size (if ordered): __ 5.25" 360k __ 5.25" 1.2M __ 3.5" 760k
Thank you for doing business with Parity Solutions. (817) 467-7818
Parity Solutions is a partnership of Gary C. Crider and Russell L. McCloud.
Federal tax identification number 75-2468376.
==============================================================================